#ifndef SDK_OHOS_API_OHOS_RTP_SENDER_INTERFACE_H_
#define SDK_OHOS_API_OHOS_RTP_SENDER_INTERFACE_H_

#include "api/ref_count.h"
#include "api/scoped_refptr.h"
#include "api/media_types.h"
#include "api/rtp_parameters.h"
#include "api/dtmf_sender_interface.h"
#include "api/rtp_sender_interface.h"

namespace ohoswebrtc {

class OHOSMediaTrackInterface;
class OHOSMediaStreamInterface;


class OHOSRtpSenderInterface : public webrtc::RefCountInterface {
  public:
    /** Returns true if successful in setting the track. Fails if an audio track is set on a video RtpSender, or vice-versa. */
    virtual bool set_track(rtc::scoped_refptr<OHOSMediaTrackInterface> track) = 0;
     
    /** The RTCMediaStreamTrack associated with the sender. */
    virtual rtc::scoped_refptr<OHOSMediaTrackInterface> track() const = 0;

    /**The dtlsTransport attribute exposes the DTLS transport on which the media is sent. It may be null. */
    virtual rtc::scoped_refptr<webrtc::DtlsTransportInterface> dtls_transport() const = 0;

    /**Returns primary SSRC used by this sender for sending media. Returns 0 if not yet determined. */
    virtual uint32_t ssrc() const = 0;
    
    /**Media type for Audio or video receiver */
    virtual cricket::MediaType media_type() const = 0;

    /** Not to be confused with "mid", this is a field we can temporarily use to uniquely identify a receiver until we implement Unified Plan SDP.*/
    virtual const std::string send_id() const = 0;

    /**Returns a list of media stream ids associated with this sender's track. */
    virtual const std::vector<std::string> stream_ids() const = 0;
    
    /** Set stream ids, eliminating duplicates in the process.*/
    virtual void SetStreams(const std::vector<std::string> stream_ids) const = 0;

    /**Returns the list of encoding parameters that will be applied when the SDP local description is set */
    virtual std::vector<webrtc::RtpEncodingParameters> init_send_encodings() const = 0;

    virtual webrtc::RtpParameters parameters() const = 0;

    virtual bool set_parameters(webrtc::RtpParameters &parameters) = 0;

    /** native RtpSenderInterface */
    virtual rtc::scoped_refptr<webrtc::RtpSenderInterface> rtp_sender() const = 0;

    /** native DtmfSenderInterface */
    virtual rtc::scoped_refptr<webrtc::DtmfSenderInterface> dtmf_sender() const = 0;

    /** Sets a defined frame encryptor that will encrypt the entire frame
     * before it is sent across the network. This will encrypt the entire frame
     * using the user provided encryption mechanism regardless of whether SRTP is
     * enabled or not.
     */
    virtual void SetFrameEncryptor(rtc::scoped_refptr<webrtc::FrameEncryptorInterface> frame_encryptor) = 0;

    /** Returns a pointer to the frame encryptor set previously by the
     * user. This can be used to update the state of the object.
    **/
    virtual rtc::scoped_refptr<webrtc::FrameEncryptorInterface> GetFrameEncryptor() = 0;
  
    virtual void SetEncoderToPacketizerFrameTransformer(
      rtc::scoped_refptr<webrtc::FrameTransformerInterface> frame_transformer) = 0;

    /** Sets a user defined encoder selector
     *Overrides selector that is (optionally) provided by VideoEncoderFactory.
    **/
    virtual void SetEncoderSelector(
      std::unique_ptr<webrtc::VideoEncoderFactory::EncoderSelectorInterface>
          encoder_selector) = 0;
  
    /** Default implementation of SetFrameTransformer. */
    virtual void SetFrameTransformer(rtc::scoped_refptr<webrtc::FrameTransformerInterface> frame_transformer) = 0;
  
  protected:
  virtual ~OHOSRtpSenderInterface() {}
};

}

#endif